package top.jiangqiang.qianyi.common.constants.http;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import top.jiangqiang.qianyi.common.base.http.ErrorStatus;

/**
 * @Date 2023/10/19 17:28
 * @Author Jiangqiang
 */
@Getter
@Slf4j
@AllArgsConstructor
public enum Error400Status implements ErrorStatus {
    //400请求参数错误
    BAD_REQUEST(100, "请求失败"),
    BAD_REQUEST_INCORRECT_USERNAME_OR_PASSWORD(101, "用户名或密码错误"),
    BAD_REQUEST_DECRYPTION_FAILED(102, "解密失败，请检查加密参数"),
    BAD_REQUEST_USER_ALREADY_EXISTS(103, "用户已经存在"),
    BAD_REQUEST_SORT_FIELD_DOES_NOT_EXIST(104, "排序字段不存在"),

    ;

    //业务状态码
    private final int code;
    private final String message;

    @Override
    public int getRawStatusCode() {
        return 400;
    }

    @Override
    public HttpStatus getHttpStatus() {
        return HttpStatus.BAD_REQUEST;
    }
}
